import 'package:flutter/material.dart';
import 'package:untitled/routes.dart';

class PageContent extends StatelessWidget {
  final String name;
  const PageContent({Key key,this.name}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('当前页面$name'),),
      body: ListView(
        children: [
          ElevatedButton(
            child: Text('首页'),
            onPressed: (){
              Navigator.pushNamed(context, Routes.home);
            },
          ),
          ElevatedButton(
            child: Text('登录页'),
            onPressed: (){
              Navigator.pushNamed(context, Routes.login);
            },
          ),
          ElevatedButton(
            child: Text('404'),
            onPressed: (){
              Navigator.pushNamed(context, '/adcd');
            },
          ),
          ElevatedButton(
            child: Text('房屋详情页'),
            onPressed: (){

              Navigator.pushNamed(context, '/room/2222');
            },
          )
        ],
      ),
    );
  }
}
